package Beans;

import java.math.BigDecimal;
import java.math.BigInteger;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "courier")
public class Courier {
	private Express express;
	private int courierId;
	private int sex;
	private BigInteger mobileNum;
	private String IDcard;
	private String courierName;
	private String courierComment;
	private String company;
	private String rfid;
	private String pwd;
	private String sernum;
	private String addr;
	private int status;// 快递员状态 0：正常；1：删除。
	private String role;// 快递角色
	private BigInteger errorTimes;// 快递员存错次数
	private BigDecimal errorRate;// 存错率

	public int offLineTime;// 离线时间
	public BigInteger saveNum;// 存件数

	@GenericGenerator(name = "generator", strategy = "native")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "courier_id", unique = true, nullable = false)
	public int getCourierId() {
		return courierId;
	}

	public void setCourierId(int courierId) {
		this.courierId = courierId;
	}

	@Column(name = "courier_mobileNum")
	public BigInteger getMobileNum() {
		return mobileNum;
	}

	public void setMobileNum(BigInteger mobileNum) {
		this.mobileNum = mobileNum;
	}

	@Column(name = "courier_name")
	public String getCourierName() {
		return courierName;
	}

	public void setCourierName(String courierName) {
		this.courierName = courierName;
	}

	@Column(name = "courier_comment")
	public String getCourierComment() {
		return courierComment;
	}

	public void setCourierComment(String courierComment) {
		this.courierComment = courierComment;
	}

	@Column(name = "courier_company")
	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	@Column(name = "courier_RFID")
	public String getRfid() {
		return rfid;
	}

	public void setRfid(String rfid) {
		this.rfid = rfid;
	}

	@Column(name = "courier_sernum")
	public String getSernum() {
		return sernum;
	}

	public void setSernum(String sernum) {
		this.sernum = sernum;
	}

	@Column(name = "courier_status")
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Column(name = "courier_psd")
	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	@Column(name = "courier_sex")
	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	@Column(name = "courier_IDCard")
	public String getIDcard() {
		return IDcard;
	}

	public void setIDcard(String iDcard) {
		IDcard = iDcard;
	}

	@Column(name = "courier_address")
	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	@Column(name = "courier_role")
	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	@ManyToOne
	@JoinColumn(name = "courier_express_id")
	public Express getExpress() {
		return express;
	}

	public void setExpress(Express express) {
		this.express = express;
	}

	@Column(name = "courier_errorTimes")
	public BigInteger getErrorTimes() {
		return errorTimes;
	}

	public void setErrorTimes(BigInteger errorTimes) {
		this.errorTimes = errorTimes;
	}

	@Column(name = "courier_errorRate")
	public BigDecimal getErrorRate() {
		return errorRate;
	}

	public void setErrorRate(BigDecimal errorRate) {
		this.errorRate = errorRate;
	}

	public void print() {
		System.out.println("-------------Courier------------");
	}

}
